package homework;

public class User {
    private String account;
    private String password;
    private String email;
    public User(String account,String password,String email){
        this.account=account;
        this.password=password;
        this.email=email;
    }
    public User(String account,String password){
        this.account=account;
        this.password=password;
        this.email=null;
    }
    public void showUserInfo(){
        System.out.println("账号："+account);
        System.out.println("密码："+password);
        if(this.email!=null){
            System.out.println("邮箱："+email);
        }
    }
    public static void main(String[] args){
        User user1=new User("ma1234","123456","ma1234@qq.com");
                user1.showUserInfo();
        User user2=new User("qu1234","123456");
                user2.showUserInfo();
    }
}
